package com.mapper;

import com.entity.User;
import com.handler.CustomerEntityMapper;
import com.handler.FindByQuery;
import com.handler.SelectListAs;
import com.ymx.darling.mapper.EntityMapper;
import com.ymx.darling.mapper.SqlMapper;
import com.ymx.darling.mapper.annotation.Cache;
import com.ymx.darling.mapper.annotation.ProviderInvoker;
import com.ymx.darling.mapper.annotation.Select;
import com.ymx.darling.wrapper.QueryWrapper;

import java.util.List;

/**
 * @author 爱Java的小于
 */
@Cache
public interface UserMapper extends CustomerEntityMapper<User> {
    @Select("select id, user_name, user_age, user_political, user_sex, user_address from user where user_age = #{age}")
    List<User> selectByAge(Integer age);

    @ProviderInvoker(FindByQuery.class)
    List<User> selectByQuery(QueryWrapper queryWrapper);

    @ProviderInvoker(SelectListAs.class)
    <E> List<E> selectListAs(QueryWrapper wrapper, Class<?> type);
}
